SELECT
  stream_id,
  stream_uuid,
  stream_version,
  created_at,
  deleted_at
FROM "<%= schema %>".streams
WHERE $1::text IS NULL OR stream_uuid LIKE $1::text
ORDER BY <%= sort_by %> <%= sort_dir %>
LIMIT $2 OFFSET $3;
